Skip to content

accounts: left pad keybytes-to-encrypt#3032

Merged
fjl merged 1 commit into
ethereum:developfrom
Gustav-Simonsson:keystore_padding
Sep 30, 2016
Merged

accounts: left pad keybytes-to-encrypt#3032
fjl merged 1 commit into
ethereum:developfrom
Gustav-Simonsson:keystore_padding

Conversation

@Gustav-Simonsson
Copy link
Copy Markdown

@Gustav-Simonsson Gustav-Simonsson commented Sep 23, 2016

https://github.com/ethcore/parity/issues/2263

This ensures privkey-bytes-to-encrypt are always of length 32, so the resulting ciphertext is also always 32 bytes. Note that this requires no unpadding in decryption, as a decrypted padded byte slice will be interpreted as the same integer by big.Int.SetBytes

It's backwards compatible as the decryption code is unmodified.

Copy link
Copy Markdown
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test that encrypts and decrypts a small key.

Copy link
Copy Markdown
Member

@bas-vk bas-vk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjl fjl merged commit b4cc8cb into ethereum:develop Sep 30, 2016
@fjl fjl removed the review label Sep 30, 2016
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants